From: robertl Date: Fri, 9 Apr 2010 16:32:29 +0000 (+0000) Subject: Don't make an empty track a the start of each track download from Garmin. Don't... X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~199^2~19 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=68c0a1b71df1b3494997e79204568aa606dfab93;p=gpsbabel.git Don't make an empty track a the start of each track download from Garmin. Don't add extraneous segment markers in the header. --- diff --git a/garmin.c b/garmin.c index 5f232c259..62cf3fca0 100644 --- a/garmin.c +++ b/garmin.c @@ -454,7 +454,8 @@ track_read(void) } - if ((trk_head == NULL) || array[i]->tnew) { + if (trk_head == NULL || array[i]->ishdr + || (array[i]->tnew && i > 0 && !array[i - 1]->ishdr)) { trk_head = route_head_alloc(); trk_head->rte_num = trk_num; if (trk_seg_num == 1) { @@ -1050,7 +1051,6 @@ route_write(void) static void track_hdr_pr(const route_head *trk_head) { - (*cur_tx_tracklist_entry)->tnew = gpsTrue; (*cur_tx_tracklist_entry)->ishdr = gpsTrue; if ( trk_head->rte_name ) { strncpy((*cur_tx_tracklist_entry)->trk_ident, trk_head->rte_name, sizeof((*cur_tx_tracklist_entry)->trk_ident)); diff --git a/jeeps/gpsapp.c b/jeeps/gpsapp.c index f14153fc1..81dc8e1c3 100644 --- a/jeeps/gpsapp.c +++ b/jeeps/gpsapp.c @@ -4397,7 +4397,6 @@ void GPS_D311_Get(GPS_PTrack *trk, UC *s) /* Forerunner */ identifier = GPS_Util_Get_Short(s); sprintf((*trk)->trk_ident, "%d", identifier); - (*trk)->tnew = 1; return; }